﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetDon.OA.Data.EntityClasses;

namespace NetDon.OA.Interface
{
    public class WebConfig
    {
        public static string MadeupPaper = System.Configuration.ConfigurationManager.AppSettings["MadeupPaper"];
        public static string Whole = System.Configuration.ConfigurationManager.AppSettings["Whole"];
        public static string LessThanCarLoad = System.Configuration.ConfigurationManager.AppSettings["LessThanCarLoad"];

        //超级权限用户
        public static string PositionLevels = System.Configuration.ConfigurationManager.AppSettings["岗位等级"];
        //跨公司角色
        public static string SuperRoles = System.Configuration.ConfigurationManager.AppSettings["角色"];
        public static string CalculateByWeight = System.Configuration.ConfigurationManager.AppSettings["按重量计算"];

        public static bool IsCalculateByWeight(Guid goodsShippedTypeId)
        {

            var postionLevelArray = CalculateByWeight.Split(new char[] { ';' });
            return postionLevelArray.Contains(new DictionaryEntity(goodsShippedTypeId).Name);
        }

        public static bool IsCalculateByWeight(string goodsShippedTypeName)
        {

            var postionLevelArray = CalculateByWeight.Split(new char[] { ';' });
            return postionLevelArray.Contains(goodsShippedTypeName);
        }
    }
}
